-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddl: disallow dropping index on auto_increment column (#11360) #11399
ddl: disallow dropping index on auto_increment column (#11360) #11399
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -295,7 +296,7 @@ func (p *preprocessor) checkAutoIncrement(stmt *ast.CreateTableStmt) { | |||
} | |||
} | |||
if (autoIncrementMustBeKey && !isKey) || count > 1 { | |||
p.err = errors.New("Incorrect table definition; there can be only one auto column and it must be defined as a key") | |||
p.err = autoid.ErrWrongAutoKey.GenWithStackByArgs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If arguments is empty, I think we can use GenWithStack()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zz-jason GenWithStack()
accepts a formatted string, but there is no such string here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
@tangenta merge failed. |
/run-check_dev_2 |
/rebuild |
This error has occurred for the second time. @crazycs520 PTAL? |
Cherry-pick #11360.